Repository navigation
fix(libSceHmd2): gate EnableMirroring, GetPredictedDisplayTime and SetRenderConfig on the reprojection session - #15361
Conversation
…tRenderConfig on the reprojection session Since Initialize creates a reprojection session, these three still returned 0x8a72000b inside one. Gate them on reprojectionState like the neighbouring exports. Inside a session GetPredictedDisplayTime with a null output and SetRenderConfig with a bit outside bits 0 and 32 or a nonzero second or third argument return the codes measured in a PPSA01317 session; every other form keeps its throwing body. The test tells inside from outside a session and the debt entry says so.
Progress report (f6232fc → a3876ad)📉 System libraries: 26.36% (-0.01%, -3 reverted functions)
|
| Library | Name |
|---|---|
| libSceHmd2 | sceHmd2ReprojectionEnableMirroring |
| libSceHmd2 | sceHmd2ReprojectionGetPredictedDisplayTime |
| libSceHmd2 | sceHmd2ReprojectionSetRenderConfig |
Changed libraries (implemented exports)
| Library | Before | After | Change |
|---|---|---|---|
| libSceHmd2 | 22/153 (14.38%) | 19/153 (12.42%) | -1.96% |
✅ AMD GPU test: passedPR head
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (3, not counted against this PR)Validation IDs already present on main (4 IDs in 461 tests)Skipped (7)ReproduceAutomated build and test on a contributor's AMD machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
The session gate and measured error paths match the implementation evidence, and the exact-head Windows build and focused test pass.
What I ran
Reviewed all three changed files at head a3876adc8484ee0a0335e90218ea24ba1418c2a0 against base f6232fcfda70644495273f6b8dd88cf0603463d6; the current-base merge preview is clean. Local environment: Debian Linux, Python 3.11.2. The hosted Windows workflow built the changed guest_hmd2 test; I did not build locally.
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 15361
git diff --check f6232fcfda70644495273f6b8dd88cf0603463d6...a3876adc8484ee0a0335e90218ea24ba1418c2a0
python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base f6232fcfda70644495273f6b8dd88cf0603463d6 --head a3876adc8484ee0a0335e90218ea24ba1418c2a0 --json
python3 tools/pr_test_quality.py --root /marc/AnyPS5 --json core/libs/tests/GuestHmd2.cpp
python3 tools/pr_overlap.py --branch refs/review/15361/current --repo boykopovar/AnyPS5 --jobs 4
gh run view 41569771032 --repo boykopovar/AnyPS5 --log | grep -i -C 2 'guest_hmd2'Results
| Check | Result | Note |
|---|---|---|
| Source, tests and evidence | passed | Session and argument precedence are covered. |
| Diff and conventions | passed | No whitespace or template errors. |
| Export ABI audit | passed | Warnings do not name the three changed exports. |
| Test registration | passed | Existing guest_hmd2 target is registered. |
| Test-quality heuristic | passed | Possible-registration warning is a false positive; CMake registration was verified. |
| Current-base merge preview | passed | Clean against the PR base. |
| Hosted Windows build and test | passed | Exact head; guest_hmd2 passed. |
| Other applicable hosted checks | passed | Conventions, portability, labels, eligibility and report passed. |
| Local build or CTest | not run | Hosted Windows supplied exact-head build/test evidence. |
| Automated overlap helper | failed | GitHub response parser error; targeted search found no duplicate of these three functions. |
Precheck table and raw outputs
| Check | Status | Note |
|---|---|---|
| Build and compile | not applicable | Precheck does not build. |
| Diff check | passed | Exact head/base diff. |
| Conventions and template | passed | All convention checks passed. |
| Changed-export ABI audit | failed to launch | Optional helper absent from isolated snapshot; workspace audit ran. |
| Python checks | not applicable | No relevant Python files changed. |
| Dependency and mergeability | passed | Exact-head current-base merge preview clean. |
| Build-dependent C++ tests | not applicable | Precheck does not build. |
| Test-quality heuristics | failed to launch | Optional helper absent from isolated snapshot; workspace heuristic ran. |
| Negative controls | not applicable | No changed Python test supports a no-build control. |
Workspace ABI audit summary:
status: passed_with_warnings
symbols: 142
findings: 175
findings naming the three changed exports: 0
The audit warnings are explicit NID-versus-symbol-hash alias warnings; the changed signatures are unchanged. The test-quality helper reported possible-unregistered-cpp-test; I verified the existing nested CMake target and CTest registration.
Precheck optional-helper errors:
/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15361-a3876adc8484/head-a3876adc8484-71517a23/tools/pr_abi_audit.py': [Errno 2] No such file or directory
/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15361-a3876adc8484/head-a3876adc8484-71517a23/tools/pr_test_quality.py': [Errno 2] No such file or directory
Overlap helper output:
pr_overlap: Invalid \uXXXX escape: line 1 column 263591 (char 263590)
Hosted Windows test output:
Start 2485: guest_hmd2
1/1 Test #2485: guest_hmd2 ....................... Passed 0.02 sec
100% tests passed, 0 tests failed out of 1
Other hosted checks:
conventions pass
intake pass
labels pass
library-portability pass
report pass
eligibility pass
linux and specialized jobs skipped by workflow filters
Negative control
Not run by me. The PR body does not report a negative control for this change.
Findings
Blocking: None found in the three changed files.
Non-blocking: Open #8645 covers five different reprojection exports, not these three. Its branch is based on an older main and pairwise merging shows shared-file conflicts; this PR independently merges cleanly against current main, so no dependency on #8645 is indicated.
Sources
- Session gate and measured-argument handling at the reviewed head
- No-session and in-session assertions at the reviewed head
- In-session test calls at the reviewed head
- Recorded firmware 13.40 measurements cited by the PR
- Debt entry at the reviewed head
Not verified
No local build or CTest, physical-console run, headset-attached behavior, or independent reproduction of the firmware 13.40 measurements was performed. Linux and specialized CI jobs were skipped. The automated overlap helper failed to parse GitHub’s response; targeted PR search and file inspection were used instead.
To get this to a good state
No further action is needed for this head. I will review again if it changes.
What
Since #7658,
sceHmd2ReprojectionInitializecreates a reprojection session, butsceHmd2ReprojectionEnableMirroring,sceHmd2ReprojectionGetPredictedDisplayTimeandsceHmd2ReprojectionSetRenderConfig(added in #12634) still return 0x8a72000b ("no session") inside one. Their technical-debt entry says to gate them once Initialize can create a session; a probe reported on #8645 found it still unmet. PPSA05666 calls EnableMirroring and SetRenderConfig right after SetMirroringOption, so it is told there is no session while it has one.The three now test the session first, like their neighbours: without a session each still returns 0x8a72000b for every argument and writes nothing. Inside one, the answers measured for rejected arguments in a PPSA01317 session are returned:
sceHmd2ReprojectionGetPredictedDisplayTimewith a null output answers 0x8a720008, andsceHmd2ReprojectionSetRenderConfigwith a bit other than bits 0 and 32 in the first argument or a nonzero second or third argument answers 0x8a720009. Every other form (all ofsceHmd2ReprojectionEnableMirroring, acceptedSetRenderConfigforms,GetPredictedDisplayTimewith an output) throws throughNotImplemented_nid_no_patch, as the other unimplemented reprojection exports do. The 0x8a720019 thatGetPredictedDisplayTimereturned in that session without a headset is deliberately not returned, because the answer with a headset is unknown. The debt entry says so.GuestHmd2.cppcould not tell the two cases apart, because every earlier call ran without a session. It now calls the three inside a session: the measured answers are pinned, and for the forms that still throw it requires only that the call does not answer as without a session (either a return or a throw), so the not-yet-implemented body is not pinned. It also re-runs the no-session checks aftersceHmd2ReprojectionTerminate.Tested
mainf4489e210f):guest_hmd2passes.tools/check_conventions.pypassed.Export.cppfrommainand the new test,guest_hmd2fails with "HMD2: mirroring inside a reprojection session answered as without one"; with this change it passes. The no-session assertions are unchanged and still pass.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repository